C program to find repeating elements in an array